/**
 * 
 * create by duongpq
 * 
 */
function buildHtml(id,url,picture,width,height,target){
    var var_banner = '';
    if(Right(picture,3).toLowerCase() != 'swf'){ 
        var_banner +='<a href="' + url + '" target="' +target+'" >';
        var_banner +='<img src="' + picture + '" width="' + width +'" height="' + height +'" />';
        var_banner +='</a>';
    }else{
        var imgpath = picture;
        var_banner += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"  width="' + width +'" height="' + height +'"  >';
        var_banner += '<param name="movie" value="' + imgpath + '" />';
        var_banner += '<param name="quality" value="high" />';
        var_banner += '<PARAM NAME="wmode" VALUE="transparent" />';
        var_banner += '<embed src="' + imgpath + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" WMODE="transparent" type="application/x-shockwave-flash"  width="' + width +'" height="' + height +'" ></embed>';
        var_banner += '</object>';			
    }
    document.getElementById(id).innerHTML = var_banner;
}
function Right(str, n){
    if (n <= 0)
        return "";
    else if (n > String(str).length)
        return str;
    else {
        var iLen = String(str).length;
        return String(str).substring(iLen, iLen - n);
    }
}